package com.power.sifa.approve.model.enumeration;

import cn.hutool.core.util.ObjectUtil;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;


/**
 * 审批过程材料类型常量类
 */
@Getter
public enum Tp_procmaterialEnum {

    /**
     * 调解申请书
     */
    MATER_MEAPPLY(Tp_procmaterial.MATER_MEAPPLY, "mater_meapply", "调解申请书", null,  Tp_classifyEnum.MATERIAL,null),

    /**
     * 调解登记表
     */
    MATER_MEREGISTER(Tp_procmaterial.MATER_MEREGISTER, "mater_meregister", "调解登记表", null,
            Tp_classifyEnum.MATERIAL,null),
    /**
     * 调解记录
     */
    MATER_MERECORD(Tp_procmaterial.MATER_MERECORD, "mater_merecord", "调解记录", null,
            Tp_classifyEnum.MATERIAL, null),
    /**
     * 调解协议书
     */
    MATER_MEACCORD(Tp_procmaterial.MATER_MEACCORD, "mater_meaccord", "调解协议书", null,
            Tp_classifyEnum.MATERIAL, null),

    /**
     * 被申请人答复书
     */
    HEAR_REPLYLETTER(Tp_procmaterial.HEAR_REPLYLETTER, "hear_replyletter", "被申请人答复书", null,
            Tp_classifyEnum.MATERIAL, null),

    /**
     * 行政复议委托调查函
     */
    HEAR_INVESTLETTER(Tp_procmaterial.HEAR_INVESTLETTER, "hear_investletter", "行政复议委托调查函", null,
            Tp_classifyEnum.MATERIAL, Tp_stageEnum.HEAR),

    /**
     * 行政复议案件调查笔录
     */
    HEAR_NOTE(Tp_procmaterial.HEAR_NOTE, "hear_note", "行政复议案件调查笔录", null,
            Tp_classifyEnum.MATERIAL, null),

    /**
     * 行政复议听证通知书
     */
    HEAR_HEARING(Tp_procmaterial.HEAR_HEARING, "hear_hearing", "行政复议听证通知书", "HearAuditHearing.docx",
            Tp_classifyEnum.MATERIAL, Tp_stageEnum.HEAR),

    /**
     * 行政复议案件调查(听证)会签到卡
     */
    HEAR_CHECKCARD(Tp_procmaterial.HEAR_CHECKCARD, "hear_checkcard", "行政复议案件调查(听证)会签到卡", null,
            Tp_classifyEnum.MATERIAL, null),

    /**
     * 鉴定申请书
     */
    HEAR_DETERMINEAPL(Tp_procmaterial.HEAR_DETERMINEAPL, "hear_determineapl", "鉴定申请书", null,
            Tp_classifyEnum.MATERIAL, null),

    /**
     * 行政复议委托鉴定函
     */
    HEAR_DETERMINE(Tp_procmaterial.HEAR_DETERMINE, "hear_determine", "行政复议委托鉴定函", null,
            Tp_classifyEnum.MATERIAL, Tp_stageEnum.HEAR),

    /**
     * 停止执行原行政行为申请书
     */
    HEAR_STOPAPL(Tp_procmaterial.HEAR_STOPAPL, "hear_stopapl", "停止执行原行政行为申请书", null,
            Tp_classifyEnum.MATERIAL, null),

    /**
     * 停止执行行政行为通知书
     */
    HEAR_STOP(Tp_procmaterial.HEAR_STOP, "hear_stop", "停止执行行政行为通知书", "HearAuditStop.docx",
            Tp_classifyEnum.MATERIAL,  Tp_stageEnum.HEAR),

    /**
     * 延期审理通知书
     */
    HEAR_DELAY(Tp_procmaterial.HEAR_DELAY, "hear_delay", "延期审理通知书", "HearAuditDelay.docx",
            Tp_classifyEnum.MATERIAL,  Tp_stageEnum.HEAR),

    /**
     * 中止行政复议通知书
     */
    HEAR_HANGUP(Tp_procmaterial.HEAR_HANGUP, "hear_hangup", "中止行政复议通知书", "HearAuditHangup.docx",
            Tp_classifyEnum.MATERIAL,  Tp_stageEnum.HEAR),

    /**
     * 恢复审理通知书
     */
    HEAR_RESTORE(Tp_procmaterial.HEAR_RESTORE, "hear_restore", "恢复审理通知书", "HearAuditRestore.docx",
            Tp_classifyEnum.MATERIAL,  Tp_stageEnum.HEAR),

    /**
     * 行政复议终止决定书
     */
    HEAR_TERMIN(Tp_procmaterial.HEAR_TERMIN, "hear_termin", "行政复议终止决定书", "HearAuditTermin.docx",
            Tp_classifyEnum.DOCUMENT,  Tp_stageEnum.DECISION),


    /**
     * 行政复议决定书 (审理决定产生)
     */
    HEAR_DECISION(Tp_procmaterial.HEAR_DECISION, "hear_decision", "行政复议决定书", "HearAuditDecision.docx",
            Tp_classifyEnum.DOCUMENT,  Tp_stageEnum.DECISION),


    /**
     * 驳回行政复议申请决定书
     */
    HEAR_REJECT(Tp_procmaterial.HEAR_REJECT, "hear_reject", "驳回行政复议申请决定书", "HearAuditReject.docx",
            Tp_classifyEnum.DOCUMENT,  Tp_stageEnum.DECISION),

    /**
     * 责令履行行政复议决定通知书
     */
    HEAR_PERFORM(Tp_procmaterial.HEAR_PERFORM, "hear_perform", "责令履行行政复议决定通知书", "ExecuteAuditPerform.docx",
            Tp_classifyEnum.MATERIAL,  Tp_stageEnum.EXECUTE),

    /**
     * 履行行政复议决定催告书
     */
    HEAR_REMINDER(Tp_procmaterial.HEAR_REMINDER, "hear_reminder", "履行行政复议决定催告书", "ExecuteAuditReminder.docx",
            Tp_classifyEnum.MATERIAL,  Tp_stageEnum.EXECUTE),


    /**
     * 行政复议调解书
     */
    HEAR_MEDIATE(Tp_procmaterial.HEAR_MEDIATE, "hear_mediate", "行政复议调解书", null,
            Tp_classifyEnum.MATANDDOC,  Tp_stageEnum.DECISION),

    /**
     * 行政复议和解书
     */
    HEAR_RECONCILIATE(Tp_procmaterial.HEAR_RECONCILIATE, "hear_reconciliate", "行政复议和解书", null,
            Tp_classifyEnum.MATANDDOC,  Tp_stageEnum.DECISION),

    /**
     * 撤回行政复议申请书
     */
    HEAR_WITHDRAW(Tp_procmaterial.HEAR_WITHDRAW, "hear_withdraw", "撤回行政复议申请书", null,
            Tp_classifyEnum.MATERIAL,  Tp_stageEnum.DECISION),

    /**
     * 行政复议听证记录
     */
    HEAR_RECORDS(Tp_procmaterial.HEAR_RECORDS, "hear_records", "行政复议听证记录", null,
            Tp_classifyEnum.MATERIAL,  null),


    /**
     * 行政复议调卷函
     */
    HEAR_MOBILIZE(Tp_procmaterial.HEAR_MOBILIZE, "hear_mobilize", "行政复议调卷函", null,
            Tp_classifyEnum.MATERIAL,  Tp_stageEnum.HEAR),


    /**
     * 勘验记录
     */
    HEAR_INQUEST(Tp_procmaterial.HEAR_INQUEST, "hear_inquest", "勘验记录", null,
            Tp_classifyEnum.MATERIAL, null),


    /**
     * 补正行政复议申请通知书
     */
    ADMRE_APPEND(Tp_procmaterial.ADMRE_APPEND,"admre_append","补正行政复议申请通知书","AdmreAuditAppendNotice.docx",
            Tp_classifyEnum.DOCUMENT, null),


    /**
     * 被申请人答复通知书
     */
//    ADMRE_ANSWER(Tp_procmaterial.ADMRE_REPLY,"admre_answer","被申请人答复通知书",null,
//            Tp_classifyEnum.DOCUMENT, Tp_stageEnum.ACCEPT),
    /**
     * 行政复议申请受理通知书
     */
    ADMRE_ACCEPT(Tp_procmaterial.ADMRE_ACCEPT,"admre_accept","行政复议申请受理通知书","AdmreAuditAcceptNotice.docx",
            Tp_classifyEnum.DOCUMENT, Tp_stageEnum.ACCEPT),

    /**
     * 不予受理行政复议申请决定书
     */
    ADMRE_NOACCEPT(Tp_procmaterial.ADMRE_NOACCEPT,"admre_noaccept","不予受理行政复议申请决定书","AdmreAuditNoacceptDecision.docx",
            Tp_classifyEnum.DOCUMENT, Tp_stageEnum.ACCEPT),
    /**
     * 行政复议决定书 (受理调解产生)
     */
    ADMRE_RESULT(Tp_procmaterial.ADMRE_RESULT,"admre_result","行政复议决定书",null,
            Tp_classifyEnum.DOCUMENT, null),
    /**
     * 行政复议监督通知书
     */
    ADMRE_SUPNOTICE(Tp_procmaterial.ADMRE_SUPNOTICE,"admre_supnotice","行政复议监督通知书",null,
            Tp_classifyEnum.DOCUMENT, null),
    /**
     * 行政复议监督告知书
     */
    ADMRE_SUPREP(Tp_procmaterial.ADMRE_SUPREP,"admre_suprep","行政复议监督告知书",null,
            Tp_classifyEnum.DOCUMENT, null),
    /**
     * 行政复议受理审批表
     */
    ADMRE_APPROVE(Tp_procmaterial.ADMRE_APPROVE,"admre_approve","行政复议受理审批表",null,
            Tp_classifyEnum.DOCUMENT, null),
    /**
     * 行政复议答复通知书
     */
    ADMRE_REPLY(Tp_procmaterial.ADMRE_REPLY,"admre_reply","行政复议答复通知书","AdmreAuditAcceptReply.docx",
            Tp_classifyEnum.DOCUMENT, Tp_stageEnum.ACCEPT),

    /**
     * 行政复议案件审批表
     */
    ADMRE_REPORT(Tp_procmaterial.ADMRE_REPORT,"admre_report","行政复议案件审批表",null,
            Tp_classifyEnum.DOCUMENT, Tp_stageEnum.ACCEPT),

    /**
     * 行政复议告知书
     */
    ARRIVE_INFORM(Tp_procmaterial.ARRIVE_INFORM,"arrive_inform","行政复议告知书","AdmreAuditNotification.docx",
            Tp_classifyEnum.MATERIAL , Tp_stageEnum.ACCEPT),

    /**
     * 行政复议转送函
     */
    ARRIVE_FORWARDING(Tp_procmaterial.ARRIVE_FORWARDING,"arrive_forwarding","行政复议转送函",null,
            Tp_classifyEnum.MATERIAL , Tp_stageEnum.ACCEPT),

    /**
     * 责令受理通知书
     */
    ARRIVE_DUTYACCEPT(Tp_procmaterial.ARRIVE_DUTYACCEPT,"arrive_dutyaccept","责令受理通知书",null,
            Tp_classifyEnum.MATERIAL , Tp_stageEnum.ACCEPT),

    /**
     * 责令恢复审理通知书
     */
    ARRIVE_DUTYRESTORE(Tp_procmaterial.ARRIVE_DUTYRESTORE,"arrive_dutyrestore","责令恢复审理通知书",null,
            Tp_classifyEnum.MATERIAL , Tp_stageEnum.ACCEPT),

    /**
     * 规范性文件转送函（一）
     */
    ARRIVE_FORWARDONE(Tp_procmaterial.ARRIVE_FORWARDONE,"arrive_forwardone","规范性文件转送函（一）",null,
            Tp_classifyEnum.MATERIAL , Tp_stageEnum.HEAR),

    /**
     * 规范性文件转送函（二）
     */
    ARRIVE_FORWARDTWO(Tp_procmaterial.ARRIVE_FORWARDTWO,"arrive_forwardtwo","规范性文件转送函（二）",null,
            Tp_classifyEnum.MATERIAL , Tp_stageEnum.HEAR),

    /**
     * 第三人参加行政复议通知书
     */
    ARRIVE_PARTICIPATE(Tp_procmaterial.ARRIVE_PARTICIPATE,"arrive_participate","第三人参加行政复议通知书",null,
            Tp_classifyEnum.MATERIAL , Tp_stageEnum.HEAR),

    /**
     * 不同意参加行政复议通知书
     */
    ARRIVE_DISAGREE(Tp_procmaterial.ARRIVE_DISAGREE,"arrive_disagree","不同意参加行政复议通知书",null,
            Tp_classifyEnum.MATERIAL , Tp_stageEnum.HEAR),

    /**
     * 行政复议强制执行决定书
     */
    ARRIVE_FORCE(Tp_procmaterial.ARRIVE_FORCE,"arrive_force","行政复议强制执行决定书","ExecuteAuditForce.docx",
            Tp_classifyEnum.MATERIAL , Tp_stageEnum.EXECUTE),

    /**
     * 行政复议意见书
     */
    ARRIVE_OPINION(Tp_procmaterial.ARRIVE_OPINION,"arrive_opinion","行政复议意见书",null,
            Tp_classifyEnum.MATERIAL , Tp_stageEnum.EXECUTE),

    /**
     * 行政复议建议书
     */
    ARRIVE_PROPOSE(Tp_procmaterial.ARRIVE_PROPOSE,"arrive_propose","行政复议建议书",null,
            Tp_classifyEnum.MATERIAL , Tp_stageEnum.EXECUTE),

    /**
     * 政务处分建议书
     */
    ARRIVE_PUNISH(Tp_procmaterial.ARRIVE_PUNISH,"arrive_punish","政务处分建议书","ExecuteAuditPunish.docx",
             Tp_classifyEnum.MATERIAL , Tp_stageEnum.EXECUTE),

    /**
     * 被申请人提交的证据清单及证据材料
     */
    ARCHIVE_INVENTORY(Tp_procmaterial.ARCHIVE_INVENTORY,"archive_inventory","被申请人提交的证据清单及证据材料",null,
            Tp_classifyEnum.MATERIAL , Tp_stageEnum.EXECUTE),

    /**
     * 被申请人的法定代表人和委托代理人的身份证明及授权委托书
     */
    ARCHIVE_EMPOWER(Tp_procmaterial.ARCHIVE_EMPOWER,"archive_empower","被申请人的法定代表人和委托代理人的身份证明及授权委托书",null,
            Tp_classifyEnum.MATERIAL , Tp_stageEnum.EXECUTE),

    /**
     * 第三人提出的书面意见书
     */
    MATER_WRITTEN(Tp_procmaterial.MATER_WRITTEN,"mater_written","第三人提出的书面意见书",null,
            Tp_classifyEnum.MATERIAL , Tp_stageEnum.HEAR),

    /**
     * 第三人提交的证据清单及证据材料
     */
    MATER_INVENTORY(Tp_procmaterial.MATER_INVENTORY,"mater_inventory","第三人提交的证据清单及证据材料",null,
            Tp_classifyEnum.MATERIAL , Tp_stageEnum.HEAR),

    /**
     * 自定义材料类型
     */
    MATER_CUSTOMER(Tp_procmaterial.MATER_CUSTOMER, "mater_customer", "自定义材料类型", null, Tp_classifyEnum.MATERIAL, null),

    /**
     * 委员会专家论证过程材料
     */
    HEAR_EXPERT(Tp_procmaterial.HEAR_EXPERT, "hear_expert", "委员会专家论证过程材料", null, Tp_classifyEnum.MATERIAL, null),

    /**
     * 专家邀请函
     */
    HEAR_EXPERTINVITATIE(Tp_procmaterial.HEAR_EXPERTINVITATIE, "hear_expertinvitatie", "专家邀请函", null, Tp_classifyEnum.MATERIAL, null),

    /**
     * 专家论证会议通知
     */
    HEAR_EXPERTNOTICE(Tp_procmaterial.HEAR_EXPERTNOTICE, "hear_expertnotice", "专家论证会议通知", null, Tp_classifyEnum.MATERIAL, null),

    /**
     * 专家会议笔录
     */
    HEAR_EXPERTNOTE(Tp_procmaterial.HEAR_EXPERTNOTE, "hear_expertnote", "专家会议笔录", null, Tp_classifyEnum.MATERIAL, null),


    /**
     * 查阅复制记录材料
     */
    HEAR_TRAWL(Tp_procmaterial.HEAR_TRAWL, "hear_trawl", "查阅复制记录材料", null, Tp_classifyEnum.MATERIAL, null),


    /**
     * 查阅复制申请书
     */
    HEAR_TRAWLFORM(Tp_procmaterial.HEAR_TRAWLFORM, "hear_trawlform", "查阅复制申请书", null, Tp_classifyEnum.MATERIAL, null),

    /**
     * 是否同步制发行政复议意见书
     */
    HEAR_ASYNAPPROVE(Tp_procmaterial.HEAR_ASYNAPPROVE, "hear_asynapprove", "是否同步制发行政复议意见书", null, Tp_classifyEnum.MATERIAL, null),

    /**
     * 受理后调解申请
     */
    HEAR_AFTERMEAPPLY(Tp_procmaterial.HEAR_AFTERMEAPPLY, "hear_aftermeappl", "受理后调解申请", null, Tp_classifyEnum.MATERIAL, null),

    /**
     * 受理后调解协议
     */
    HEAR_AFTERMERECORD(Tp_procmaterial.HEAR_AFTERMERECORD, "hear_aftermerecord","受理后调解协议", null, Tp_classifyEnum.MATERIAL, null),

    /**
     * 调解不成下达复议决定书
     */
    HEAR_AFTERFAILDECIDE(Tp_procmaterial.HEAR_AFTERFAILDECIDE, "hear_afterfaildecide","调解不成下达复议决定书", null, Tp_classifyEnum.MATERIAL, null),

    /**
     * 听取意见情况表
     */
    HEAR_LISTENFORM(Tp_procmaterial.HEAR_LISTENFORM, "hear_listenform","听取意见情况表", "听取意见情况表", Tp_classifyEnum.MATERIAL, null),


    /**
     * 听取意见情况表
     */
    HEAR_INTERVENE(Tp_procmaterial.HEAR_INTERVENE, "hear_intervene","干预行政复议活动记录表", "干预行政复议活动记录表", Tp_classifyEnum.DOCUMENT, null),

    /**
     * 复议监督通知书
     */
    SUPERVISE_NOTICE(Tp_procmaterial.SUPERVISE_NOTICE, "supervise_notice","复议监督通知书", "复议监督通知书", Tp_classifyEnum.DOCUMENT, null),

    /**
     * 复议监督告知书
     */
    SUPERVISE_TELL(Tp_procmaterial.SUPERVISE_TELL, "supervise_tell","复议监督告知书", "复议监督告知书", Tp_classifyEnum.DOCUMENT, null),

    /**
     * 复议监督调查结果
     */
    SUPERVISE_RESULT(Tp_procmaterial.SUPERVISE_RESULT, "supervise_result","调查结果材料", "调查结果材料", Tp_classifyEnum.DOCUMENT, null);


    /**
     * 枚举id
     */
    private Integer id;

    /**
     * 枚举name
     */
    private String name;

    /**
     * 描述
     */
    private String desc;

    /**
     * 文件名称-
     */
    private String filename;


    /**
     * 材料类型
     */
    private Tp_classifyEnum classifyEnum;

    /**
     * 材料阶段
     */
    private Tp_stageEnum stageEnum;


    Tp_procmaterialEnum(Integer id, String name, String desc, String filename, Tp_classifyEnum classifyEnum, Tp_stageEnum stageEnum) {
        this.id = id;
        this.name = name;
        this.desc = desc;
        this.filename = filename;
        this.classifyEnum = classifyEnum;
        this.stageEnum = stageEnum;
    }

    public static Tp_procmaterialEnum getById(Integer id) {
        Tp_procmaterialEnum[] procmaterials = Tp_procmaterialEnum.values();
        for (Tp_procmaterialEnum procmaterial : procmaterials) {
            if (procmaterial.id.equals(id)) {
                return procmaterial;
            }
        }
        return null;
    }

    public static List<Tp_procmaterialEnum> getByStage(Tp_stageEnum stage) {
        List<Tp_procmaterialEnum> procmaterialList = new ArrayList<>();
        Tp_procmaterialEnum[] procmaterials = Tp_procmaterialEnum.values();
        for (Tp_procmaterialEnum procmaterial : procmaterials) {
            if (ObjectUtil.isNotNull(procmaterial.getStageEnum()) && procmaterial.getStageEnum().equals(stage)) {
                procmaterialList.add(procmaterial);
            }
        }
        return procmaterialList;
    }


}
